echo off
IF "%1"=="" (
	echo Building framework.dll...
	echo on
	gcc -c tree.c framework.c
	gcc -shared -o framework.dll tree.o framework.o
	echo off
	echo Done!
) ELSE IF "%1" == "help" (
	echo Format:
	echo "make arg1 arg2 ..."
	echo .
	echo Arguments:
	echo   *no arguments*: Build the project dll
	echo   test: Build a driver binary file
	echo   clean: Remove intermediate build files
) ELSE IF "%1" == "clean" (
	del *.o
) ELSE IF "%1" == "commit-ready" (
	del *.o
	del *.exe
) ELSE IF "%1" == "test" (
	IF  "%2"=="" (
		echo Missing Argument
	) ELSE IF "%2"=="help" (
		echo Arguments:
		echo   tree: Tree test executable
		echo   linkedlist: Linked List test executable
		echo   hashtable: HashTable and PerfectHashTable test executable
	) ELSE IF "%2"=="tree" (
		echo Building %2 %1...
		echo on
		gcc -o test.exe tree.c framework.c treedriver.c
		echo off
		echo Done!
	) ELSE IF "%2" == "hashtable" (
		echo Building %2 %1...
		echo on
		gcc -c -ggdb linkedlist.c hashtable.c hashtabledriver.c
		gcc -o test.exe linkedlist.o hashtable.o hashtabledriver.o
		echo off
		echo Done!
	) ELSE IF "%2" == "linkedlist" (
		echo Building %2 %1...
		echo on
		gcc -o test.exe linkedlist.c linkedlistdriver.c
		echo off
		echo Done!
	) ELSE (
		echo Unknown Test: %2
	)
) ELSE IF "%1" == "text-interface" (
	echo Building %1...
	echo on
	gcc -Wall -Wextra -c tree.c hashtable.c linkedlist.c commandmap.c textinterface.c
	gcc -o tlifeo.exe tree.o hashtable.o linkedlist.o commandmap.o textinterface.o
	echo off
	echo Done!
)
